package com.jx.smartbot.controller.base;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.http.HttpStatus;

import com.gocom.imoss.common.Exception.AuthorizedException;
import com.jx.smartbot.VO.base.StatusData;

@RestControllerAdvice
public class BaseRestController {
	private static org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(BaseRestController.class);
	 public static final String JSON_UTF_8 = "application/json; charset=UTF-8";
	 
	 @ExceptionHandler(value = {AuthorizedException.class})
	 @ResponseStatus(HttpStatus.NOT_FOUND)
	 public StatusData handlerServerError(AuthorizedException ex){
		 return new StatusData(ex.getCode(),ex.getMessage());
	 }
	 
}
